package org.rcgwt.client.ui.grid.theme;

import java.util.List;

import org.rcgwt.client.ui.grid.controller.IElementModelEventController;
import org.rcgwt.client.ui.grid.controller.IGridModelController;
import org.rcgwt.client.ui.grid.controller.IViewController;
import org.rcgwt.client.ui.grid.internal.model.ICellModel;
import org.rcgwt.client.ui.grid.internal.model.IColumnModel;
import org.rcgwt.client.ui.grid.internal.model.IGridModel;
import org.rcgwt.client.ui.grid.internal.model.IGroupModel;
import org.rcgwt.client.ui.grid.internal.model.IGroupTitleModel;
import org.rcgwt.client.ui.grid.internal.model.IHeaderModel;
import org.rcgwt.client.ui.grid.internal.model.IRowModel;
import org.rcgwt.client.ui.grid.internal.model.ITitleCellModel;
import org.rcgwt.client.ui.grid.internal.model.ITitleRowModel;
import org.rcgwt.client.ui.grid.internal.model.IViewModel;
import org.rcgwt.client.ui.grid.model.IGridWidget;
import org.rcgwt.client.ui.grid.provider.IFocusProvider;
import org.rcgwt.client.ui.grid.provider.IOrderProvider;
import org.rcgwt.client.ui.grid.provider.IOverProvider;
import org.rcgwt.client.ui.grid.renderer.ICellEditorRenderer;
import org.rcgwt.client.ui.grid.renderer.ICellRenderer;
import org.rcgwt.client.ui.grid.renderer.IGridRenderContext;
import org.rcgwt.client.ui.grid.renderer.IGridRenderer;
import org.rcgwt.client.ui.grid.renderer.IGroupRenderer;
import org.rcgwt.client.ui.grid.renderer.IGroupTitleRenderer;
import org.rcgwt.client.ui.grid.renderer.IHeaderRenderer;
import org.rcgwt.client.ui.grid.renderer.IRowRenderer;
import org.rcgwt.client.ui.grid.renderer.ITitleCellRenderer;
import org.rcgwt.client.ui.grid.renderer.ITitleRowRenderer;
import org.rcgwt.client.ui.grid.renderer.IViewRenderContext;
import org.rcgwt.client.ui.grid.renderer.IViewRenderer;

/**
 * Manage the setting for interface style
 * 
 * @author Olivier Oeuillot
 * 
 */
public interface IGridTheme {

    // ------------------- Renderers -------------------------- //

    IRowRenderer getRowRenderer(IRowModel row);

    ITitleRowRenderer getTitleRowRenderer(ITitleRowModel titleRowModel);

    IGroupTitleRenderer getGroupTitleRenderer(IGroupTitleModel groupTitleModel);

    IGroupRenderer getGroupRenderer(IGroupModel groupModel);

    ICellRenderer getCellRenderer(ICellModel cellModel);

    ICellEditorRenderer getCellEditorRenderer(IColumnModel columnModel);

    ITitleCellRenderer getTitleCellRenderer(ITitleCellModel titleCellModel);

    IHeaderRenderer getHeaderRenderer(IHeaderModel headerModel);

    IViewRenderer getViewRenderer(IViewModel viewModel);

    IGridRenderer getGridRenderer(IGridModel gridModel);

    // ------------------- LES STYLES NAMES -------------------------- //
    CssStyle getGridCssStyle(IGridModel gridModel);

    CssStyle getGridThemeCssStyle(IGridModel gridModel);

    CssStyle getTableStyleName(IViewModel view);

    CssStyle getViewCssStyle(IViewModel view);

    CssStyle getScrollableTableContainerCssStyle();

    CssStyle getHeaderCssStyle(IHeaderModel headerModel);

    CssStyle getRowStyleName(IViewRenderContext viewRenderContext,
            IRowModel rowModel);

    CssStyle getCellStyleName(IGridRenderContext gridRenderContext,
            ICellModel cell);

    CssStyle getGroupStyleName(IGridRenderContext gridRenderContext,
            IGroupModel group);

    CssStyle getGroupTitleCssStyle(IGroupTitleModel group);

    CssStyle getTitleCellCssStyle(ITitleCellModel titleCell);

    CssStyle getTitleRowCssStyle(ITitleRowModel titleRow);

    CssStyle getTitleCellSizeDraggerCssStyle(ITitleCellModel titleCellModel);

    CssStyle getTitleCellOrderMarkerCssStyle(ITitleCellModel titleCellModel);

    CssStyle getTitleCellPopupMarkerCssStyle(ITitleCellModel titleCellModel);

    CssStyle getTitleCellTextCssStyle(ITitleCellModel titleCellModel);

    CssStyle getFocusedTitleRowCssStyle(ITitleRowModel titleRow);

    // ------------------- LES TAILLES -------------------------- //

    int getGridBorderWidth();

    int[] getGridPaddings();

    int[] getTableMargins();

    int getDataTableCellPadding();

    int getDataTableCellSpacing();

    int getViewBorderWidth();

    int getHorizontalHeaderHeight(IHeaderModel view);

    int getVerticalHeaderWidth(IHeaderModel view);

    int getHeaderSeparatorSize(IHeaderModel view);

    int getMaximumVerticalScrollBarWidth();

    // ------------------- Les Controllers -------------------------- //

    IViewController getViewController(IViewModel viewModel);

    IGridModelController getGridModelController(IGridModel gridModel);

    void addElementEventControllers(List<IElementModelEventController> list,
            IGridWidget gridWidget);

    // -------------------- Les providers --------------------- //
    IOverProvider getOverProvider(IGridWidget gridWidget);

    IFocusProvider getFocusProvider(IGridWidget gridWidget);

    IOrderProvider getColumnsOrderProvider(IGridWidget gridWidget);
}
